﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.ProductSearchModels>" %>
<%@ Import Namespace="SDT.Model" %>
<%@ Import Namespace="SDT.Site.ViewModels" %>
<div class="t_red"><strong>Dịp</strong></div>
<div id="list_choice">
    <ul>
        <% if (Model.ProductHolidays != null && Model.ProductHolidays.Count() > 0)
           {

               foreach (var c in Model.ProductHolidays)
               {
                   var path = string.Format("/product/index/{0}/{1}/{2}/{3}/{4}/{5}",
                   Model.TypeID.HasValue ? Model.TypeID.Value : 0,                   
                   Model.PriceID.HasValue ? Model.PriceID.Value : 0,
                   Model.CategoryID.HasValue ? Model.CategoryID.Value : 0,                 
                   c.ID,
                   Model.EventID.HasValue ? Model.EventID.Value : 0,
                   Model.SellID.HasValue ? Model.SellID.Value : 0);
                   path = SDT.Lib.Helpers.TextHelper.ToUrlShort(path);
                   var css = c.ID == Model.HolidayID ? "act" : string.Empty;
                   if (Model.Keyword != null && Model.Keyword != string.Empty) path = path + "?key=" + Model.Keyword;
                %>
                <li><%=Html.CheckBox("chkType", css != string.Empty ? true : false, new { onclick = "if(this.checked){location.href='" + path + "'}" })%><a href="<%=path %>" class="<%=css %>"><%= c.Name %></a></li>
               <%}
           }%>
    </ul>
</div>